package com.kczd.jinlan.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.TextView;

import com.kczd.jinlan.R;

/**
 * yang_g
 * 绑定安全问题
 * Created by Administrator on 2017/5/18.
 */

public class SafetyActivity extends Activity {
    private TextView id_fanhui;
    private Spinner sp_value;    //问题一
    private Spinner sp_value_one;//问题二
    private Spinner sp_value_two;//问题三
    // 适配器，到时候和Spinner连接起来
    private ArrayAdapter<String> adapter;
    private static final String[] arr = {"你的爸爸叫什么?", "你的妈妈叫什么", "你的爸爸叫什么", "你的妈妈叫什么", "你的姐姐叫什么"};
    private static final String[] arr1 = {"你的爸爸叫什么?", "你的妈妈叫什么", "你的爸爸叫什么", "你的妈妈叫什么", "你的妈妈叫什么"};
    private static final String[] arr2 = {"你的妈妈叫什么?", "你的妈妈叫什么", "你的妈妈叫什么", "你的妈妈叫什么", "你的姐姐叫什么"};

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.safety_activity);
    }

    @Override
    public void onContentChanged() {
        super.onContentChanged();

        sp_value = (Spinner) findViewById(R.id.sp_value);
        adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_spinner_dropdown_item, arr);
        // 设置adapter的下拉风格
        adapter.setDropDownViewResource(android.R.layout.simple_list_item_1);
        // 将adapter添加到Spinner中去
        sp_value.setAdapter(adapter);

        sp_value_one = (Spinner) findViewById(R.id.sp_value_one);
        adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_spinner_dropdown_item, arr1);
        // 设置adapter的下拉风格item_dialogspinselect
        adapter.setDropDownViewResource(android.R.layout.simple_list_item_1);
        // 将adapter添加到Spinner中去
        sp_value_one.setAdapter(adapter);

        sp_value_two = (Spinner) findViewById(R.id.sp_value_two);
        adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_spinner_dropdown_item, arr2);
        // 设置adapter的下拉风格
        adapter.setDropDownViewResource(android.R.layout.simple_list_item_1);
        // 将adapter添加到Spinner中去
        sp_value_two.setAdapter(adapter);


        id_fanhui = (TextView) findViewById(R.id.id_fanhui);
        id_fanhui.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }


}
